'''
   窗体中的画布示例：
    绘制小球
'''
import tkinter.messagebox
from tkinter import * 

win = tkinter.Tk()
win.title('画布示例')  #定义窗体标题
win.geometry('400x200')  #定义窗体的大小400x200像素

can = tkinter.Canvas(win, height=200, width=400) #定义画布

id = can.create_line(15,15,190,15)
io1 = can.create_oval(50, 50, 100, 100, fill='blue') #画一蓝色圆
io2 = can.create_oval(59, 59, 68, 68, fill='white')  #画一白色小圆

coord = 15, 120, 210, 220
arc = can.create_arc(coord, extent=150, fill="purple")  #画一个扇形

can.pack()
win.mainloop()
